<?php
/** 
 * Dao生成类
 * gcDaoFactory
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class gcDaoFactory {

    private static $instance=NULL;

    /**
     * getInstance
     * @return  self::$instance
     */
    public static function getInstance(){
        if(self::$instance == NULL){
            self::$instance = new gcDaoFactory();
        }
        return self::$instance;
    }

    /**
     * Dao生成
     * createDao
     * @param   string  $path
     * @return  string  $srtClass
     */
    public function createDao($path){
        require_once($path.".php");

        if($i = strripos($path, "/")){
            $srtClass = substr($path, strripos($path, "/") + 1);
        }else{
            $srtClass = $path;
        }
        return new $srtClass;
    }
}
